package com.yaorange.module.security.controller;

import com.yaorange.module.security.entity.dto.LoginDTO;
import com.yaorange.module.security.service.AuthService;
import com.yaorange.response.Result;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 15332
 * @version 1.0
 * @date 2025/6/20 15:58
 * @description 登录认证控制器
 */
@RestController
public class AuthController {
  @Autowired
  private AuthService service;

  @PostMapping("/user/login")
  public Result<String> login(@Valid @RequestBody LoginDTO loginDTO){
    return Result.success(service.login(loginDTO));
  }
}
